import HelloWorld from './components/HelloWorld.vue';
import imgDemo from './components/imgDemo.vue';

const components = {
        HelloWorld,
        imgDemo
};

const iview = {
        ...components
};

const install = function(Vue, opts = {}) {
        if (install.installed) return;

        Object.keys(iview).forEach(key => {
                Vue.component(key, iview[key]);
        });
};
// auto install
if (typeof window !== 'undefined' && window.Vue) {
        install(window.Vue);
}
const API = {
        install,
        ...components
};
module.exports.default = module.exports = API;   // eslint-disable-line no-undef
